package com.czh.codesandbox.security;

import java.security.Permission;

/*
 * ClassName: DefaultSecurityManager
 * Package: com.czh.security
 * Description:
 * @Author: CZH
 * @Create: 2025
 */
public class DefaultSecurityManager extends SecurityManager{


    @Override
    public void checkPermission(Permission perm) {
//        super.checkPermission(perm);
    }

    /**
     * 检查执行权限
     * @param cmd
     */
    @Override
    public void checkExec(String cmd) {
        throw new SecurityException("checkExec 权限异常：" + cmd);
    }

    /**
     * 检查读取权限
     * @param file
     *
     */
    @Override
    public void checkRead(String file) {
        throw new SecurityException("checkRead 权限异常：" + file);
    }

    /**
     * 检查写入权限
     * @param file
     */
    @Override
    public void checkWrite(String file) {
        throw new SecurityException("checkWrite 权限异常：" + file);
    }

    /**
     * 检查删除权限
     * @param file
     */

    @Override
    public void checkDelete(String file) {
        throw new SecurityException("checkDelete 权限异常：" + file);
    }

    /**
     * 检查连接网络权限
     * @param host
     * @param port
     */
    @Override
    public void checkConnect(String host, int port) {
        throw new SecurityException("checkConnect 权限异常：" + host + ":" + port);
    }
}
